package entity;

import java.io.Serializable;
import java.sql.Time;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;

@Entity
public abstract class PaymentItemEntity implements Serializable {
    private static long serialVersionUID = 1L;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public static void setSerialVersionUID(long aSerialVersionUID) {
        serialVersionUID = aSerialVersionUID;
    }
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private double amountToStakeholder;
    private double amountToTCube;
    private String explanation;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date dateCreated;
    private boolean paid;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date datePaid;
    private Time timePaid;
    
    @ManyToOne
    private PaymentManagementEntity paymentManagement;
    @ManyToOne
    private StakeholderEntity stakeholder;
    
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (getId() != null ? getId().hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PaymentItemEntity)) {
            return false;
        }
        PaymentItemEntity other = (PaymentItemEntity) object;
        if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.PaymentItem[ id=" + getId() + " ]";
    }

    public double getAmountToStakeholder() {
        return amountToStakeholder;
    }

    public void setAmountToStakeholder(double amountToStakeholder) {
        this.amountToStakeholder = amountToStakeholder;
    }

    public double getAmountToTCube() {
        return amountToTCube;
    }

    public void setAmountToTCube(double amountToTCube) {
        this.amountToTCube = amountToTCube;
    }

    public String getExplanation() {
        return explanation;
    }

    public void setExplanation(String explanation) {
        this.explanation = explanation;
    }

    public Date getDateCreated() {
        return dateCreated;
    }

    public void setDateCreated(Date dateCreated) {
        this.dateCreated = dateCreated;
    }

    public boolean isPaid() {
        return paid;
    }

    public void setPaid(boolean paid) {
        this.paid = paid;
    }

    public Date getDatePaid() {
        return datePaid;
    }

    public void setDatePaid(Date datePaid) {
        this.datePaid = datePaid;
    }

    public Time getTimePaid() {
        return timePaid;
    }

    public void setTimePaid(Time timePaid) {
        this.timePaid = timePaid;
    }

    public PaymentManagementEntity getPaymentManagement() {
        return paymentManagement;
    }

    public void setPaymentManagement(PaymentManagementEntity paymentManagement) {
        this.paymentManagement = paymentManagement;
    }

    public StakeholderEntity getStakeholder() {
        return stakeholder;
    }

    public void setStakeholder(StakeholderEntity stakeholder) {
        this.stakeholder = stakeholder;
    }

}